<?php
require("../configuration.php");
$sel_val=$_POST['sel_val'];

$query = mysql_query("SELECT * FROM groups WHERE faculty_id='$sel_val'");
$num = mysql_num_rows($query);


echo             "<select  name=\"group\" id=\"group_select\" >";
					
for($i=0;$i<$num;$i++){
	$row = mysql_fetch_array($query);
	echo "<option value=".$row['group_id']. " >".$row['group_name']. "</option>";
}

echo "</select>";
?>